home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume5 / xwps3 / patch1 < prev    next >
Encoding:
Internet Message Format  |  1989-09-24  |  2.1 KB

  1. Path: uunet!island!argv
  2. From: argv@island.uu.net (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v05i005: xwps3, Patch1
  5. Message-ID: <1090@island.uu.net>
  6. Date: 24 Sep 89 17:54:28 GMT
  7. Organization: Island Graphics, Marin County, California
  8. Lines: 52
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: uunet!cs.buffalo.edu!sigmast!planck!meyer
  12. Posting-number: Volume 5, Issue 5
  13. Archive-name: xwps3/patch1
  14. Patch-To: xwps3: Volume 5, Issue 2
  15.  
  16. [ From the Author: ]
  17.  
  18. I have been informed of a major problem with my 'xwps' program (which
  19. has been dubbed 'xwps3' by our moderator) which will cause it to
  20. fill filesystems with NULLs on little endian machines (i.e. VAXEN and
  21. VAXStations).  It seems that a little piece of code left over from the
  22. translation from 'xwd' causes major problems.
  23.  
  24. The original code (xwd) had to translate to big endian form on little
  25. endian machines in order to generate a common bitmap format file.  It
  26. doesn't even get invoked on big endian machines so I never questioned
  27. it.  Here's the context diff.
  28.  
  29. *** xwps.old    Fri Sep 22 17:17:07 1989
  30. --- xwps.c    Fri Sep 22 17:17:25 1989
  31. ***************
  32. *** 144,150 ****
  33.   Window window;
  34.   FILE *out;
  35.   {
  36. -     unsigned long swaptest = 1;
  37.       XColor *colors;
  38.       unsigned buffer_size;
  39.       int win_name_size;
  40. --- 144,149 ----
  41. ***************
  42. *** 257,270 ****
  43.           header.window_y = (xwdval) win_info.y;
  44.       }
  45.       header.window_bdrwidth = (xwdval) win_info.border_width;
  46. -     if (*(char *) &swaptest) {
  47. -         _swaplong((char *) &header, sizeof(header));
  48. -         for (i = 0; i < ncolors; i++) {
  49. -             _swaplong((char *) &colors[i].pixel, sizeof(long));
  50. -             _swapshort((char *) &colors[i].red, 3 * sizeof(short));
  51. -         }
  52. -     }
  53.   
  54.       openImage(out, header.pixmap_width, header.pixmap_height);
  55.       writeImage(out,image,header.pixmap_width, header.pixmap_height,colors,ncolors);
  56. --- 256,261 ----
  57. -- 
  58.    Thinking quickly, the IBM System Jock     # Bob Meyer
  59. uttered an incantation in EBCDIC and made    # Calspan Advanced Tech. Center
  60. the sign of the Terminated Fork.             # ...!sunybcs!planck!meyer
  61.    The UNIX Guru only smiled and trapped him in a recursive SED script.
  62.